package student;

import com.tern.data.Entity;
import com.tern.data.Record;


import com.tern.web.PageForm;

public class StudentIndexPage extends PageForm {
	private Entity entity;
	private int stuID;
	private Record row;

	final protected boolean onLoad() throws Exception {
	
		entity = Entity.createFromSchema("students");
		stuID = Integer.parseInt(session.getAttribute("userID").toString());

		this.entity.retriveFromDB("stuID=" + stuID);
		if(entity.getRowsCount()!=0)
		{
			this.row = this.entity.get(0);
		}
	
		return true;
	}

    public java.util.Map<String, Object> getStudent(){
    	return row.getMap();}
}
